package org.mzyyn.qr.enums;

import org.qr.xiaocao.common.constants.DeletedStatusEnum;

/**
 * 全局来源平台枚举
 */
public enum SourceStatusEnum {
    QQ(0, "qq小程序"),
    WX(1, "微信小程序"),
    H5(2, "h5");

    private Integer code;
    private String name;

    SourceStatusEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    /**
     * 根据code返回枚举对象
     *
     * @param code
     * @return
     */
    public static DeletedStatusEnum getByCode(Integer code) {
        if (code == null) {
            return null;
        }
        for (DeletedStatusEnum commandEnum : DeletedStatusEnum.values()) {
            if (commandEnum.getCode().intValue() == code.intValue()) {
                return commandEnum;
            }
        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
